<meta charset="utf-8">
{% extends "base.html" %}

{% block app_content %}
    <table class="table table-hover">
        <tr>
            <td width="200px"><img src="{{ user.avatar(200) }}"></td>
            <td>
                <h2>User: {{ user.username }}</h2>
                {% if user.about_me %}<p><b>{{ user.about_me }}</b></p>{% endif %}
                {% if user.last_seen %}
                	<p>Last seen on: </p><!-- Flask-Moment渲染此时间戳。使用format()，可以控制字符串的输出格式 -->
                    <p>{{ moment(user.last_seen).format('LLL') }}</p>
                {% endif %}
                <p>{{ user.followers.count() }} followers, {{ user.followed.count() }} following.</p>
                {% if user == current_user %}
                <p><a href="{{ url_for('edit_profile') }}">Edit your profile</a></p>
                {% elif not current_user.is_following(user) %}
                <p><a href="{{ url_for('follow', username=user.username) }}">Follow</a></p>
                {% else %}
                <p><a href="{{ url_for('unfollow', username=user.username) }}">Unfollow</a></p>
                {% endif %}
            </td>
        </tr>
    </table>
    {% for post in posts %}
        {% include '_post.html' %}
    {% endfor %}
    <nav aria-label="...">
        <ul class="pager">
            <li class="previous{% if not prev_url %} disabled{% endif %}">
                <a href="{{ prev_url or '#' }}">
                    <span aria-hidden="true">&larr;</span> Newer posts
                </a>
            </li>
            <li class="next{% if not next_url %} disabled{% endif %}">
                <a href="{{ next_url or '#' }}">
                    Older posts <span aria-hidden="true">&rarr;</span>
                </a>
            </li>
        </ul>
    </nav>
{% endblock %}

